Skip to content

Constrain secret readers with curry arguments - #121

Open
nishu-builder wants to merge 1 commit into
mainfrom
codex/constrained-secret-readers
Open

Constrain secret readers with curry arguments#121
nishu-builder wants to merge 1 commit into
mainfrom
codex/constrained-secret-readers

Conversation

@nishu-builder

@nishu-builder nishu-builder commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • require every .caos-secrets reader= line to contain an explicit typed --base
  • declare each reader as a partial ArgTree using the exact typed argument list accepted after curry, without treating the line as a command
  • reuse the existing expression parser and ArgTree assembly, including pinned-tree :@= resolution
  • assemble and unwrap readers into the existing partial name-to-OID map without executing the resulting request
  • remove the old path-only shorthand and migrate the generic fixtures and documentation
  • keep the server-side subset matcher and secret injection model unchanged

Why

Path-only readers constrain worker identity but leave every additional argument unconstrained. Secret owners need to pin local grant policy such as an allowed destination, repository, or environment without creating repository-owned wrapper expressions.

This restores inline reader constraints removed in 91866bd94: content-addressed worker identity belongs in the source tree, while the secret owner's local constraints belong with the per-device secret grant.

Syntax

reader=--base:@=DEEP-DEPS/github-push --repo=github.com/me/project

Each reader= is one independent partial ArgTree. Missing, duplicate, rebound, malformed, untyped, and unsuitable bases fail clearly. Secret values and entropy remain out of ArgTrees; only the existing entropy-derived secret-hash enters them.

Security coverage

  • exact pinned constraints grant the secret
  • changing a pinned constraint denies it
  • copied or forged secret-hash values cannot bypass a mismatch
  • extra unpinned arguments still match
  • multiple readers retain independent bases and constraints
  • path and hash forms resolve with ordinary curry OID identity
  • malformed and obsolete reader forms fail closed

Validation

  • cargo fmt --all -- --check
  • cargo test --workspace
  • nix build
  • fresh salted result/bin/caos-cli run-tool test (44/44 passed)
  • shell syntax checks
  • git diff --check

PR #113 is stacked on this branch for conversation-specific secret integration.

@nishu-builder
nishu-builder force-pushed the codex/constrained-secret-readers branch from e4de2c7 to f7c80c3 Compare August 20, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant